function checkit() {
	var rnt = true;
	if (isblank(document.form1.CARSQ_UNITID)) {
		rnt = false;
		alert("请设置用车单位");
	} else if (isblank(document.form1.CARSQ_USERID)) {
		rnt = false;
		alert("请设置用车人");
	} else if (isblank(document.form1.CARSQ_CLID)) {
		rnt = false;
		alert("请选择使用车辆");
	}else if (!isinteger(document.form1.STAMP_FP)) {
		rnt = false;
		alert("请填写正确的油票分配数");
	} 
	else if (isblank(document.form1.CARSQ_TEL)) {
		rnt = false;
		alert("请填写联系电话");
	} else if (isblank(document.form1.CARSQ_QXYT)) {
		rnt = false;
		alert("请填写去向及用途");
	} else if (isblank(document.form1.CARSQ_KSSJ1)) {
		rnt = false;
		alert("请填写开始时间");
	} else if (isblank(document.form1.CARSQ_JZSH1)) {
		rnt = false;
		alert("请填写截至时间");
	} else if (!isinteger(document.form1.CARSQ_RS)) {
		rnt = false;
		alert("请填写正确的人数");
	}

	if (rnt) {
		$('CARSQ_KSSJ').value = parseDate($('CARSQ_KSSJ1').value)
				+ $('kssjH').value + $('kssjM').value;
		$('CARSQ_JZSH').value = parseDate($('CARSQ_JZSH1').value)
				+ $('jssjH').value + $('jssjM').value;
	}

	return rnt;
}

/**
 * 更新成功后回调函数
 */
function forwardFunc() {
	window.location.href = context
			+ '/system/tablequery/jsplist.jsp?queryKey=mysqlist';
}

/**
 * 初始化form表单项
 * 
 * @param {}
 *            json
 */
function initFunc(json) {
	if (json != null && json.success == true) {
		$('CARSQ_ID').value = json.data.CARSQ_ID;
		$('CARSQ_UNIT').value = json.data.CARSQ_UNIT;
		$('CARSQ_UNITID').value = json.data.CARSQ_UNITID;
		$('CARSQ_USER').value = json.data.CARSQ_USER;
		$('CARSQ_USERID').value = json.data.CARSQ_USERID;
		$('CARSQ_CL').value = json.data.CARSQ_CL;
		$('CARSQ_CLID').value = json.data.CARSQ_CLID;
		$('CARSQ_TEL').value = json.data.CARSQ_TEL;
		$('CARSQ_CCRW').value = json.data.CARSQ_CCRW;
		$('CARSQ_QXYT').value = json.data.CARSQ_QXYT;
		$('CARSQ_XSLC').value = json.data.CARSQ_XSLC;
		$('CARSQ_KSSJ').value = json.data.CARSQ_KSSJ;
		$('CARSQ_JZSH').value = json.data.CARSQ_JZSH;
		$('CARSQ_KSSJ1').value = formatDate(json.data.CARSQ_KSSJ
				.substring(0, 8));
		$('CARSQ_JZSH1').value = formatDate(json.data.CARSQ_JZSH
				.substring(0, 8));
		$('CARSQ_RS').value = json.data.CARSQ_RS;
		$('CARSQ_XZ').value = json.data.CARSQ_XZ;
		$('CARSQ_MEMO').value = json.data.CARSQ_MEMO;
		$('CARSQ_DJR').value = json.data.CARSQ_DJR;
		$('CARSQ_DJRID').value = json.data.CARSQ_DJRID;
		$('CARSQ_DATE').value = json.data.CARSQ_DATE;
		$('CARSQ_YY').value = json.data.CARSQ_YY;
		$('STAMP_ID').value = json.data.STAMP_ID;
		$('STAMP_COUNT').value = json.data.STAMP_COUNT;
		$('STAMP_NO').value = json.data.STAMP_NO;
		$('JSY_XM').value = json.data.JSY_XM;
		$('STAMP_FP').value = json.data.STAMP_FP;
		$('STAMP_KC').value = json.data.STAMP_KC;

		initwordbook4select('hour-scale',
				json.data.CARSQ_KSSJ.substring(8, 10), 'kssjH', true);
		initwordbook4select('minute-scale', json.data.CARSQ_KSSJ.substring(10,
						12), 'kssjM', true);
		initwordbook4select('hour-scale',
				json.data.CARSQ_JZSH.substring(8, 10), 'jssjH', true);
		initwordbook4select('minute-scale', json.data.CARSQ_JZSH.substring(10,
						12), 'jssjM', true);

		if (json.data.CARSQ_STATUS == '-1' && json.data.CARSQ_YY != '') {
			var win = new Ext.Window({
						title : '审批未通过回复内容提示',
						layout : 'fit',
						width : 500,
						height : 300,
						plain : true,

						items : [{
							layout : 'fit',
							frame : true,
							margins : '5 5 5 5',
							html : '<font class="oaFont">' + json.data.CARSQ_YY
									+ '</font>'
						}],

						buttons : [{
									text : '关 闭',
									handler : function() {
										win.close();
									}
								}]
					});

			win.show(this);
		}

	} else {
		$('CARSQ_UNITID').value = groupId;
		$('CARSQ_USERID').value = userId;
		$('CARSQ_UNIT').value = groupName;
		$('CARSQ_USER').value = userName;

		initwordbook4select('hour-scale', '', 'kssjH', true);
		initwordbook4select('minute-scale', '', 'kssjM', true);
		initwordbook4select('hour-scale', '', 'jssjH', true);
		initwordbook4select('minute-scale', '', 'jssjM', true);
	}
}

/**
 * render select list item[data]
 * 
 * @param {}
 *            value
 * @param {}
 *            cellmeta
 * @param {}
 *            record
 * @param {}
 *            rowIndex
 * @param {}
 *            columnIndex
 * @param {}
 *            store
 * @return {}
 */
function renderHeader(value, cellmeta, record, rowIndex, columnIndex, store) {
	var fieldName = Ext.getCmp(querykey).getColumnModel()
			.getDataIndex(columnIndex);
	if (fieldName == 'CAR_DATE') {
		return formatDate(value);
	}
	return value;
}

/**
 * 接收申请车辆返回值
 * @param {} record
 */
function returnSQCar(record){
	$('CARSQ_CLID').value = record.data['CAR_ID'];
	$('CARSQ_CL').value = record.data['CAR_NO'];
}

/**
 * 接收油票返回值
 * @param {} record
 */
function returnSQStamp(record){
	$('STAMP_NO').value = record.data['STAMP_NO'];
	$('STAMP_ID').value = record.data['STAMP_ID'];
	$('STAMP_COUNT').value = record.data['STAMP_SIZE'];
	$('STAMP_KC').value = record.data['STAMP_KC'];
}